package com.zk.dao;

import com.zk.po.User;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;

/**
 * <p>
 * Mapper 接口
 * </p>
 *
 * @author kun
 * @since 2022-06-08
 */
public interface UserMapper extends BaseMapper<User> {

    //根据id查询这个用户
    User findUserById(@Param("id") String id);

    //注册用户
    boolean addUser(@Param("nickname") String nickname,
                    @Param("username") String username,
                    @Param("password") String password,
                    @Param("email") String email);

    //登录用户
    User loginUser(@Param("username") String username, @Param("password") String password);

    //根据用户名查用户
    User findUserByUsername(@Param("username") String username);

    //根据用户名查用户
    User findUserByNickname(@Param("nickname") String nickname);

}
